using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using PccCommonForC;

public partial class Pub_Module_J_Banner : System.Web.UI.UserControl
{
    protected void Page_Load(object sender, EventArgs e)
    {
      /*  if (!IsPostBack)
            BindData();*/
    }

    private void BindData()
    {
        clsWebShop cls = new clsWebShop();
        PccMsg msg = new PccMsg();
        msg.CreateFirstNode("ID", "");
        msg.CreateFirstNode("NavigateUrl", "");
        msg.CreateFirstNode("ShowMK", "Y");
        DataTable dt = cls.Get_BannerByCondition(msg.GetXmlStr.ToString()).Tables[0];

        if (dt.Rows.Count > 0)
        {
            string HTML = "<div id='lofslidecontent41' class='lof41-slidecontent' style='width:560px; height:320px;'>";
            HTML += "<div class='preload'><div></div></div>";
            HTML += " <div class='lof41-main-outer'  style='width:560px; height:320px;'>";
            HTML += " <ul class='lof41-main-wapper'>";

            //Dung cho vong lap tiep theo
            string HTML1 = "";
            HTML1 += " <div class='lof41-navigator-wapper'>";
            HTML1 += "<div onclick='return false' href='' class='lof41-next'></div>";
            HTML1 += "<div class='lof41-navigator-outer'>";
            HTML1 += "<ul class='lof41-navigator'>";

            /////////////
            for (int i = 0; i < dt.Rows.Count; i++)
            {
                HTML += "<li>";
                HTML += "<img src='" + dt.Rows[i]["ImgUrl"].ToString() + "'   />";
                HTML += " <div class='lof41-main-item-desc'>";
                HTML += " <a href='" + dt.Rows[i]["NavigateUrl"].ToString() + "' style='color:white' class='LofTitile41'>" + dt.Rows[i]["Title"].ToString() + " </a><br>";
                HTML += " <div style='padding-left:5px'>";
                 HTML +=  dt.Rows[i]["Content"].ToString();
                HTML += "</div>";
                HTML += "</div>";
                HTML += "</li>";


                //Vong lap tiep theo
                HTML1 += "<li>";
                HTML1 += "<img src='" + dt.Rows[i]["ImgUrl"].ToString() + "'  />";
                HTML1 += "</li>";
            }
            
            HTML += "</ul>";
            HTML += "</div>";   
       
           
            HTML1 += "</ul>";
            HTML1 += "</div>";

            HTML += HTML1;

            HTML += "<div onclick='return false' href='' class='lof41-previous'></div>"; 
            HTML += "</div>";
            HTML += "</div>";

            ltrMaster.Text = HTML;
        }
    }
}
